prefix=[Package]
echo "$prefix Start packaging ZenS Console"
rm -rf dist

echo "$prefix Running play dist "
play dist
cd dist
for f in *.zip
 do 
	package_filename=$f 
 	package_basename="${package_filename%.*}"
 done
unzip $package_filename 

echo "$prefix Modifying package for Zens Console "
cp -r ../conf $package_basename
cp -r ../resources $package_basename
chmod +x $package_basename/start
mv $package_basename console

echo "$prefix Creating $package_filename "
rm $package_filename
zip -r $package_filename console
rm -rf console

echo "$prefix Finished package is available at dist/$package_filename"
